package com.sskj.mine;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.bean.UserData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.mine.bean.MineShopBean;
import com.sskj.mine.http.HttpConfig;
import com.sskj.mine.presenter.BasePresenter;
import com.sskj.mine.SellerApplyActivity;


/**
 * @author Hey
 * Create at  2019/05/01
 */
class SellerApplyPresenter extends BasePresenter<SellerApplyActivity> {
    // 获取冻结保证金
    public void getMoney() {
        OkGo.<HttpData<MineShopBean>>get(HttpConfig.BASE_URL + HttpConfig.GETMONEY)
                .execute(new JsonCallBack<HttpData<MineShopBean>>(this, false) {
                    @Override
                    public void onSuccess(Response<HttpData<MineShopBean>> response) {
                        HttpData<MineShopBean> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateUi(httpData.getData());
                        }
                    }
                });
    }

    public void shopVerify() {
        OkGo.<HttpData<Object>>get(HttpConfig.BASE_URL + HttpConfig.SHOPVERIFY)
                .execute(new JsonCallBack<HttpData<Object>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<Object>> response) {
                        HttpData<Object> httpData = response.body();

                        if (httpData.getStatus() == HttpConfig.OK) {
                            ToastUtil.showShort(httpData.getMsg());
                            mView.finish();
                        }
                    }
                });
    }
}
